<?php
define('DEDE_FILE','list');
require_once dirname(__FILE__).'/model/common.inc.php';

$row = $dsql->getone("select count(*) as dd from `#@__archives` where typeid =9");
$askcount = $row['dd'];
$realpages = @ceil($askcount/$tpp);
if($page > $realpages)
{
	$page = $realpages;
}
$page = isset($page) ? max(1, intval($page)) : 1;
$start_limit = ($page - 1) * $tpp;

$multipage = multiy($askcount, $realpages, $tpp, $page, "");

$query = "select * from `#@__archives`   where typeid =9 and arcrank=0 limit $start_limit, $tpp";

$dsql->Execute('me',$query);
while($row = $dsql->getarray())
{
	$row['title'] = cn_substr($row['title'],40);
	$row['title'] = str_replace($q,'<b style="color:red;">'.$q.'</b>',$row['title']);
	$archives[] = $row;
}

$dtp = new DedeTemplate();

$dtp->LoadTemplate(ASKROOT.'/template/default/browser.htm');
if($cfg_ask_rewrite=='Y')
{
	$dtp->Display();
	myecho();
	exit();
}
else
{
	$dtp->Display();
}

?>